package com.zhss.eshop.commodity.service;

import com.zhss.eshop.commodity.domain.dto.CommodityCategoryDTO;
import com.zhss.eshop.commodity.domain.model.CommodityCategory;

import java.util.List;

public interface CommodityCategoryService{


    int deleteByPrimaryKey(Long id);

    Boolean insertSelective(CommodityCategoryDTO record) throws Exception;

    CommodityCategory selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CommodityCategory record);

    /**
     * 查询根类目
     * @return 根类目集合
     * @throws Exception
     */
    List<CommodityCategory> listRoots() throws Exception;

    /**
     * 查询子类目
     * @param id 父类目id
     * @return 子类目集合
     * @throws Exception
     */
    List<CommodityCategory> listChildren(Long id) throws Exception;
    /**
     * 根据id查询类目
     * @param id 类目id
     * @return 类目
     * @throws Exception
     */
    CommodityCategoryDTO getById(Long id) throws Exception;

    /**
     * 删除类目
     * @param id 类目id
     * @return 处理结果
     * @throws Exception
     */
    Boolean remove(Long id) throws Exception;
}
